package ch.ricosoft.hr.sorter;

import ch.ricosoft.hr.Team;

public final class OutwardPointSorter extends InfoSorter {
	public int compare(Team o1, Team o2) {
		int diff = o2.getOutwardPoints() - o1.getOutwardPoints();
		if (diff == 0) {
			diff = o2.getOutwardDiff() - o1.getOutwardDiff();
			if (diff == 0) {
				diff = o2.getOutwardMade() - o1.getOutwardMade();
			}
		}
		return diff;
	}

	@Override
	public int getWins(Team t) {
		return t.getOutwardWin();
	}

	@Override
	public int getDraws(Team t) {
		return t.getOutwardDraw();
	}

	@Override
	public int getLoss(Team t) {
		return t.getOutwardLoss();
	}

	@Override
	public int getMade(Team t) {
		return t.getOutwardMade();
	}

	@Override
	public int getGotten(Team t) {
		return t.getOutwardGotten();
	}

	@Override
	public int getDiff(Team t) {
		return t.getOutwardDiff();
	}

	@Override
	public int getPoints(Team t) {
		return t.getOutwardPoints();
	}

	@Override
	public int getLossPoints(Team t) {
		return t.getOutwardLossPoints();
	}
}